import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: 花海
 * Date: 2022-11-21
 * Time: 13:33
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while(sc.hasNextLine()){
            String intial=sc.next();
            String dele=sc.next();
            LinkedList<Character>linkedList=new LinkedList<>();
            LinkedList<Character>linkedList0=new LinkedList<>();
            for (int i = 0; i < dele.length(); i++) {
                linkedList0.add(dele.charAt(i));
            }

            for (int i = 0; i < intial.length(); i++) {
                char a=intial.charAt(i);

                if(!linkedList0.contains(a)){
                    linkedList.add(intial.charAt(i));
                }


            }
            for (int i = 0; i < linkedList.size(); i++) {
                System.out.print(linkedList.get(i));
            }


        }


    }
}
